//
//  ZXTabBar.m
//  qianke
//
//  Created by ZX on 2017/6/29.
//  Copyright © 2017年 ZX. All rights reserved.
//

#import "ZXTabBar.h"
@implementation ZXTabBar



- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundImage = [UIImage imageNamed:@"tabbar-light"];
    }
    _str = @"0";
    return self;
}


/**
 *  布局子控件
 */
- (void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat buttonW ;
    // 处理其他按钮
    if (my_AppDelegate.auditR) {
       buttonW = self.width / 5;
    }else    {
        buttonW = self.width / 4;
        
    }
    CGFloat i = 0;
    for (UIView *tabBarButton in self.subviews) {
        if (![NSStringFromClass(tabBarButton.class) isEqualToString:@"UITabBarButton"]) continue;
        
        tabBarButton.width = buttonW;
        tabBarButton.x = i * buttonW;
//        if (i > 0) tabBarButton.x += buttonW;
        
        i++;
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
